import { convert } from "@/utils/fileList.js";

const filterPath = (list, moveList) => {
  let arr = [], item = {}
  list.forEach(el => {//过滤文件夹 和子目录
    if (el.type === 'FOLDER' && moveList.indexOf(el.id) < 0) {
      item = {
        id: el.id,
        name: el.name,
      }
      if (!el.isEmpty) {
        item.children = [{ name: '' }]
      }
      arr.push(item)
    }
  });
  return convert(arr, name, 1);
}

export { filterPath }